package me.w70.bot.events;

import me.w70.bot.Bot;
import me.w70.bot.gui.rs.Painter;
import me.w70.bot.scripting.Script;

public class EventCaster {

	Painter p = new Painter();

	Bot bot;

	public EventCaster(Bot bot) {
		this.bot = bot;
	}

	public void firePaint(PaintEvent pg) {
		for (Script s : bot.getLoadedScripts()) {
			if (s.isRunning()) {
				try {
				s.draw(pg.graphics);
				} catch (Exception e) {

				}
			}
		}
		p.draw(pg.graphics);
	}
}
